<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
	<title></title>
</head>
<body>
<script type="text/javascript">
function closeWin() {
	var r=confirm("Press a button!"); 
	if(r==true){
		if(confirm('是否关闭')){
			window.close();
		}
	}
}

</script>
<input type="button" value="关闭" onclick="closeWin()" />
</body>
</html>